<template>
  <div class="content-wapper" :style="{ height: height, width: width }">
    <div class="header" v-if="headerShow">
      <div class="start">
        <span class="start-title">{{ title }}</span>
      </div>
    </div>
    <div class="content" :class="headerShow ? '' : 'content-height'">
      <slot></slot>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    title: {
      type: String,
      default: ''
    },
    height: {
      type: String,
      default: '100%'
    },
    width: {
      type: String,
      default: '100%'
    },
    endTitle: {
      type: String,
      default: ''
    },
    endTitleColor: {
      type: String,
      default: '#FFD900'
    },
    endTitleShow: {
      type: Boolean,
      default: false
    },
    headerShow: {
      type: Boolean,
      default: true
    }
  },
  data () {
    return {}
  },
  methods: {
    handleClickEndTitle () {
      this.$emit('handle-click-end-title')
    }
  }
}
</script>

<style lang="scss" scoped>
@import "@/styles/element-variables.scss";
.content-wapper {
  // margin-top: 10px;
  border-radius: 3px;
  background: #000b4c;
  box-shadow: inset 0 0 39px 5px rgba(0, 70, 255, 0.51);
  .header {
    justify-content: space-between;
    padding: 10px 20px;
    height: 45px;
    width: 100%;
    background: url("../../assets/image/img_title_bg.png") no-repeat;
    background-size: 100% 100%;
    align-items: center;
    margin: auto 0;
    .start {
      border-radius: 3px;
      text-align: center;
      .start-title {
        font-family: PingFangSC-Medium;
        font-size: 20px;
        color: #00e4ff;
        align-items: center;
      }
    }
    .end-title {
      font-size: 14px;
    }
  }
  .content {
    background: $--color-content-background;
    height: calc(100% - 45px);
  }
  .content-height {
    height: 100%;
  }
}
</style>
